import type { App } from "vue";
import { createRouter, createWebHistory } from "vue-router";
import "./autoRoutes";
import getLayoutRoutes from "./autoRoutes";
import guard from "./guard";

export function setRouter(app: App) {
  app.use(router);
  guard(router);
}

console.table(getLayoutRoutes());

const router = createRouter({
  history: createWebHistory(),
  routes: [...getLayoutRoutes()],
});
